package main

import "fmt"

type reader interface {
	readBook()
}

type writer interface {
	writeBook()
}

type book struct {
}

func (b *book) readBook() {
	fmt.Println("read book")
}

func (b *book) writeBook() {
	fmt.Println("write book")
}

func main() {
	b := &book{}

	var r reader
	r = b

	r.readBook()

	var w writer
	w = r.(writer)
	w.writeBook()
}
